import { User } from '@/m_res/user'
import { UserService } from '@/service/userService'
import { UserDao } from '@/dao/UserDao'
import { Service, Inject } from 'typedi';
import { addUser } from '@/model/request/User';
import { res } from '@/utils/jsonResult';
import { User as UserType } from '@/m_res/user'

@Service()
export class UserServiceImpl implements UserService {
   

    @Inject()
    userDao!: UserDao

    GetAlluser(): User[] {
        throw new Error('Method not implemented.');
      
    }
    async GetOneUser(id: number): Promise<res<UserType | null>> {
        return await this.userDao.GetOneUser(id);
    }

    async addUser(params: addUser): Promise<res<null>> {
        return await this.userDao.addUserDao(params);
    }

    async Login(params: addUser): Promise<res<UserType | null>> {
        return await this.userDao.LoginDao(params);
    }
}